<#include "../common/head.ftl">
 <style>
 #menuu {
            top: 0px;
            margin-top:0px;
        }

        #menuu ul li a {
            display: block;
            margin: 5px 0;
            font-size: 14px;
            font-weight: bold;
            color: #333;
            width: 80px;
            height: 50px;
            line-height: 50px;
            text-decoration: none;
            text-align: center;
        }
.current1{
color: #0089E9;
font-weight:700;
}
        #menuu ul li a:hover,
        #menuu ul li a.current1 {
            color: #fff;
            background: #0088bb;
        }

        * html, * html body {
            background-image: url(about:blank);
            background-attachment: fixed;
        }

        * html #menuu {
            position: absolute;
            bottom: auto;
            top: expression(100+((e=document.documentElement.scrollTop)?e:document.body.scrollTop)+'px');
        }
 </style>
   <script type="text/javascript">
        $(function () {

            var nav = $("#menuu"); //得到导航对象

            var win = $(window); //得到窗口对象

            var sc = $(document);//得到document文档对象。

            win.scroll(function () {

                if (sc.scrollTop() >= 500) {

                    nav.addClass("fixednav");


                } else {

                    nav.removeClass("fixednav");
                }
            });
        });
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $(window).scroll(function () {
                var items = $("#itemss").find(".am-panel");
                var menuu = $("#menuu");
                var top = $(document).scrollTop();
                var currentId = ""; //滚动条现在所在位置的item id
                items.each(function () {
                    var m = $(this);
                    //注意：m.offset().top代表每一个item的顶部位置
                    if (top > m.offset().top - 100) {
                        currentId = "#" + m.attr("id");
                    } else {
                        return false;
                    }
                });

                var currentLink = menuu.find(".current1");
                if (currentId && currentLink.attr("href") != currentId) {
                    currentLink.removeClass("current1");
                    menuu.find("[href=" + currentId + "]").addClass("current1");
                }
            });
        });
    </script>
    <style>
    	.fixednav{
        	background-color:#FAFAFA !important;
        	position:fixed;
        	top:0px;
        	width:285px;
        	}
        	#menuu{
        	text-align:center;
        	
        	}
    </style>
<!-- /.menu -->
<div class="content">
    <div class="con_left">
        <div class="tttt2" style="margin-left: 78px;"><img src="${base }/resources/images/tttt.png">
            <#if baseinfo??>
            <#list baseinfo as ba>
            <span style="">${ba.name}的简历</span>
            </#list>
            </#if>
        </div>
        <ul class="cominfo" id="itemss">
            <li class="am-panel am-panel-default" id="sfxx1"><span class="am-panel-hd">身份信息</span>
                <#if status??>
	            <#list status as sts>
	            	<#if sts.download==1>
	            	<div>
	                    <ul style="">
	                    	<#if baseinfo??>
            				<#list baseinfo as ba>
	                        <li><p>联系电话 :</p><span>${ba.contact_no}</span></li>
	                        <li><p>邮箱 :</p><span>${ba.email}</span></li>
	                        <li><p>联系地址 :</p><span>${ba.city_name_1}${ba.city_name_2}${(ba.city_name_3!="null")?string(ba.city_name_3,"")}</span></li>
		                        <#if ba.political_type=="0">
		                        <li><p>政治面貌 :</p><span>群众</span></li>
		                        <#elseif ba.political_type=="1">
		                        <li><p>政治面貌 :</p><span>团员</span></li>
		                        <#elseif ba.political_type=="2">
		                        <li><p>政治面貌 :</p><span>党员</span></li>
		                        <#elseif ba.political_type=="3">
		                        <li><p>政治面貌 :</p><span>其他</span></li>
		                        <#else>
		                        </#if>
	                        </#list>
	                        </#if>
	                    </ul>	
                	</div>
                	<#else>
	                	<div class="downlook">
		                    <p onclick="download_scan()" style="cursor: pointer;">下载查看</p>
		                    <#if download_count??>
		                    <#list download_count as dl>
		                    <span>剩余下载查看次数${dl.count}</span>
		                    </#list>
		                    </#if>
	                	</div>
	            	</#if>
	            </#list>
	            </#if>
                
            </li>
            <li class="am-panel am-panel-default" id="qzyx1"><span class="am-panel-hd">求职意向</span>
                <div>
                    <ul>
                    	<#if intention??>
                    	<#list intention as it>
                        <li><p>期望行业 :</p><span>${it.industry_name }</span></li>
                        <li><p>期望职位 :</p><span>${(it.job_type_name!="null")?string(it.job_type_name,"") }</span></li>
                        <#if it.employment_type=="0">
                        <li><p>职位类型 :</p><span>全职</span></li>
                        <#elseif it.employment_type=="1">
                        <li><p>职位类型 :</p><span>兼职</span></li>
                        <#else>
                        <li><p>职位类型 :</p><span>实习</span></li>
                        </#if>
                        <li><p>工作城市 :</p><span>${(it.city_name_1!="null")?string(it.city_name_1,"")} ${(it.city_name_2!="null")?string(it.city_name_2,"")}</span></li>
                        <#if it.salary_min=="20001" && it.salary_max=="60000">
                          	<#assign salary="20001以上">
                        <#elseif it.salary_min=="1000" && it.salary_max=="20000">
                          	<#assign salary="面议">
                        <#else>
                         	<#assign salary=it.salary_min+"-"+it.salary_max>
                        </#if> 
                        <li><p>期望薪资 :</p><span>${salary}</span></li>
                        </#list>
                        </#if>
                    </ul>
                </div>
            </li>
            <li class="am-panel am-panel-default" id="jybj1"><span class="am-panel-hd">教育背景</span>
                <div>
                    <ul>
                    	<#if education??>
                    	<#list education as edu>
                    	<#if edu.certificate_type=="0">
                    	<#assign edua="大专">
                    	<#elseif edu.certificate_type=="1">
                    	<#assign edua="本科">
                    	<#elseif edu.certificate_type=="2">
                    	<#assign edua="研究生">
                    	<#elseif edu.certificate_type=="3">
                    	<#assign edua="博士">
                    	<#else>
                    	<#assign edua="">
                    	</#if>
                        <li style="padding:10px 0px"><p style="padding-bottom:0px;">
                        ${(edu.start_year!="null"&&edu.start_year!="0")?string(edu.start_year,"") }/${(edu.start_month!="null"&&edu.start_month!="0")?string(edu.start_month,"")}
                        ${(edu.end_year!="null"&&edu.end_year!="0")?string("--"+edu.end_year,"")}${(edu.end_month!="null"&&edu.end_month!="0")?string("/"+edu.end_month,"")}
                        </p>:
                        <ul class="xq"  style="margin:0px;padding:0;">
                        <li style="float:left;margin-left:15px;">
						<span style="margin-left:0;">${(edu.school_name!="null")?string(edu.school_name,"")} ${(edu.major_name!="null")?string("|"+edu.major_name,"")} |${edua }</span></li></ul></li>
                        </#list>
                        </#if>
                    </ul>
                </div>
            </li>
            <li class="am-panel am-panel-default" id="tcxq1"><span class="am-panel-hd">特长/兴趣</span>
                <div class="interest">
                	<#if interest??>
                    <#list interest as ite>
                    <p>${ite.interest?replace('\n','<br/>')?replace('\\n','<br/>')}</p>
                    </#list>
                    </#if>
                </div>
            </li>
            <li class="am-panel am-panel-default" id="sxjy1"><span class="am-panel-hd">实习经验</span>
                <div>
                    <ul>
                    	<#if internships??>
                    	<#list internships as ips>
                        <li><p style="padding-bottom:0px;">${(ips.start_date!="null"&&ips.start_date!="0000-00-00")?string(ips.start_date,"")}${(ips.end_date!="null" && ips.end_date!="0000-00-00")?string("--"+ips.end_date,"")}:</p><ul style="margin:0;padding:0;"><li style="float:left;margin-left:15px;"><span style="margin-left:0;">${ips.company_name }</span>|${ips.job_type_name } |${ips.industry_name}</li></ul></li>
                        <li><p>工作描述:</p><ul style="margin:0;padding:0;"><li><span style="margin-left:0;">${ips.job_description?replace('\n','<br/>')}</span></li></ul></li>
                        </#list>
                    	</#if>
                    </ul>
                </div>
            </li>
            <li class="am-panel am-panel-default" id="zwpj1"><span class="am-panel-hd">自我评价</span>
                <div class="interest">
                	<#if appraisal??>
                    <#list appraisal as ap>
                    <#if ap.self_appraisal?? && ap.self_appraisal!="" && ap.self_appraisal!="null">
                    <p>${ap.self_appraisal?replace('\n','<br/>')?replace('\\n','<br/>')}</p>
                    </#if>
                	</#list>
                    </#if>
                </div>
            </li>
            <li class="am-panel am-panel-default" id="grry1" ><span class="am-panel-hd">个人荣誉</span>
                <div class="interest">
                	<#if reward??>
                    <#list reward as rd>
                    <#if rd.reward?? && rd.reward!="" && rd.reward!="null">
                    	<p>${rd.reward?replace('\n','<br/>')?replace('\\n','<br/>')}</p>
                    </#if>
                	</#list>
                    </#if>
                </div>
            </li>
            <li class="am-panel am-panel-default" id="qzzs1"><span class="am-panel-hd">求职证书</span>
                <div class="interest">
                    <#if certify??>
                    <#list certify as cy>
                    <p>${cy.certify_title}</p>
                    	<#if cy.certify_url!=""&&cy.certify_url!="null"&&cy.certify_url!="(null)">
                    <div id="preview">
                    	<img src="${cy.certify_url}" >
                    </div>
                    	</#if>
                    </#list>
                    </#if>
                </div>
            </li>
        </ul>
    </div>
    <div class="con_right">
        <ul>
            <li>
                <div style="text-align: center;" class="img_border">
                <#if baseinfo??>
                <#list baseinfo as ba>
                	<#if ba.head_img?? && ba.head_img != "" && ba.head_img != "null">
                	<img src="${ba.head_img}" onerror="javascript:this.src='${base}/resources/images/usertx.png'">
                	<#else>
                	<img src="${base}/resources/images/user.png">
                	</#if>
                	<#assign interships=itps?number>
                	<#if interships gt 0>
                	<div class="expri">
                        <p>有工作经验</p>
                    </div>
                	</#if>
                    <div class="name">
	                    <p style="">${ba.name}</p>
	                    <#if ba.sex =="1">
	                    <span>女</span>
	                    </#if>
	                    <#if ba.sex =="0">
	                    <span>男</span>
	                    </#if>
	                    <#if ba.nation_name=="null">
	                    <#else>
	                    |<span>${ba.nation_name}</span>
	                    </#if>
	                    |<span>${ba.birthday}</span>
                	</div>
                </#list>
                </#if>
                </div>
            </li>
            <li class="caozuo">
            	<#if status??>
	            <#list status as sts>
	                <!-- <p class="already"><span>已测评</span></p> -->
		            <#if sts.download==1>
		            <p class="downed"><span>已经下载</span></p>
		            <#else>
		            <p class="downed" onclick="download_scan()"><span>点击下载</span></p>
		            </#if>
		            <#if sts.favorite==1>
	                <p class="colled" onclick="favorites(2)"><span>取消收藏</span></p>
	                <#else>
	                <p class="colled" onclick="favorites(1)"><span>点击收藏</span></p>
	                </#if>
                </#list>
                </#if>
            </li>
            <li>
                            <ul id="menuu">
                                <li><a href="#sfxx1" class="am-active">身份信息</a></li>
                                <li><a href="#qzyx1" class="">求职意向</a></li>
                                <li><a href="#jybj1" class="">教育背景</a></li>
                                <li><a href="#tcxq1" class="">特长/兴趣</a></li>
                                <li><a href="#sxjy1">实习经验</a></li>
                                <li><a href="#zwpj1">自我评价</a></li>
                                <li><a href="#grry1">个人荣誉</a></li>
                                <li><a href="#qzzs1">求职证书</a></li>
                            </ul>
            </li>
        </ul>
    </div>
</div>
<#include "../common/bottom.ftl">
</body>
<script type="text/javascript">
	
    //图片上传预览    IE是用了滤镜。
    function previewImage(file){
        var MAXWIDTH  = 260;
        var MAXHEIGHT = 180;
        var div = document.getElementById('preview');
        if (file.files && file.files[0])
        {
            div.innerHTML ='<img id=imghead>';
            var img = document.getElementById('imghead');
            img.onload = function(){
                var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
                img.width  =  rect.width;
                img.height =  rect.height;
//                 img.style.marginLeft = rect.left+'px';
                img.style.marginTop = rect.top+'px';
            }
            var reader = new FileReader();
            reader.onload = function(evt){img.src = evt.target.result;}
            reader.readAsDataURL(file.files[0]);
        }
        else //兼容IE
        {
            var sFilter='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
            file.select();
            var src = document.selection.createRange().text;
            div.innerHTML = '<img id=imghead>';
            var img = document.getElementById('imghead');
            img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
            var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
            status =('rect:'+rect.top+','+rect.left+','+rect.width+','+rect.height);
            div.innerHTML = "<div id=divhead style='width:"+rect.width+"px;height:"+rect.height+"px;margin-top:"+rect.top+"px;"+sFilter+src+"\"'></div>";
        }
    }
    function clacImgZoomParam( maxWidth, maxHeight, width, height ){
        var param = {top:0, left:0, width:width, height:height};
        if( width>maxWidth || height>maxHeight )
        {
            rateWidth = width / maxWidth;
            rateHeight = height / maxHeight;

            if( rateWidth > rateHeight )
            {
                param.width =  maxWidth;
                param.height = Math.round(height / rateWidth);
            }else
            {
                param.width = Math.round(width / rateHeight);
                param.height = maxHeight;
            }
        }

        param.left = Math.round((maxWidth - param.width) / 2);
        param.top = Math.round((maxHeight - param.height) / 2);
        return param;
    };
    
    //下载浏览
    function download_scan(){
    	if('${enterpriseInit[0].ent_status}'=="1"){
    		layer.alert("企业未通过审核不能下载简历", {icon: 0,skin: 'layer-ext-moon'});
    		return;
    	}
    	$.post('${base}/resume/download',{
			'resumeID': '${stu_resume_id}',
			'jobID':'${job_id}'
		},function(data){
			if(data.success){
				//layer.alert("下载简历成功", {icon: 2,skin: 'layer-ext-moon'});
				layer.alert('下载简历成功!', {
					icon: 1,
				    skin: 'layui-layer-moon' 
				    ,closeBtn: 0
				}, function(){
					window.location.reload();
				});
				//window.location="${base}/resume/r-${stu_resume_id}.html?internships=${itps}";
		  	}else{
				layer.alert(data.message, {icon: 0,skin: 'layer-ext-moon'});
			}
		});
    };
    
  	//设置收藏
    function favorites(type){
    	$.post('${base}/resume/favorties',{
			'resumeID': '${stu_resume_id}',
			'action_type' : type
		},function(data){
			if(data.success){
				layer.alert('操作成功!', {
					icon: 1,
				    skin: 'layui-layer-moon' 
				    ,closeBtn: 0
				}, function(){
					window.location.reload();
				});
				//layer.alert("收藏简历成功", {icon: 1,skin: 'layer-ext-moon'});
				//location.href="${base}/resume/";
			}else{
				layer.alert(data.message, {icon: 0,skin: 'layer-ext-moon'});
			}
		});
    }
</script>
</html>